package com.youxin.logprocess.controller;

import org.apache.log4j.Logger;


/**
 * 监控中央控制器
 * @author yingde.cao
 *
 */
public class MediatorController {
	private static Logger logger = Logger.getLogger(MediatorController.class);
	private static MediatorController mediatorController=new MediatorController();
	public static MediatorController instance(){
		return mediatorController;
	}
	
	/**
	 * 执行方法
	 */
	public void execute(){
		try {
			SparkController.instance().execute();
			MonitorWebController.instance().execute();

			
			MonitorMySqlController.instance().execute();
			MonitorKafkaController.instance().execute();
			MonitorZookeeperController.instance().execute();
			MonitorRedisController.instance().execute();	
			StatController.instance().add(MonitorMySqlController.instance());
			StatController.instance().add(MonitorWebController.instance());
			StatController.instance().add(MonitorKafkaController.instance());
			StatController.instance().add(MonitorZookeeperController.instance());
			StatController.instance().add(MonitorRedisController.instance());	
			
			
			StatController.instance().add(MonitorNginxController.instance());
			
			StatController.instance().execute();

		} catch (Exception e) {
			logger.error("MediatorController",e);
		}
		

	}
	
}
